package z_app_lotto2;

import java.io.*;
import java.util.*;
class Data
{
	String count; // 로또 회차
	Vector data = new Vector();
	Vector col;
	String fileName=null;

	public Data(String f)
	{
		this.fileName = f;
		read();
	}
	public void read()
	{
		FileReader reader = null;
		BufferedReader readBuffer = null;

		try
		{
			reader = new FileReader(fileName);
			readBuffer = new BufferedReader(reader);

		}catch(Exception ex){System.out.println("file open error -->" + ex);}

		String str=null;
		StringTokenizer token=null;

		try
		{
			while(true) //파일로 부터 데이터 읽기
			{
				str = readBuffer.readLine();
				if(str == null) break;

				token = new StringTokenizer(str,",");
				col = new Vector();
				while(token.hasMoreElements())
				{
					col.add(token.nextToken());
				}
				data.add(col);
			}
			readBuffer.close();
		}catch(Exception ex){System.out.println("file reading error -->" + ex);}
	}

	public Vector getData(){
		return data;
	}

	public static void main(String args[])
	{
		Data d = new Data("lotto.dat");

	}
}
